home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Demos / Widget / Wbutton.stklos < prev    next >
Encoding:
Text File  |  1995-08-23  |  871 b   |  27 lines

  1. ;;;;
  2. ;;;; STk adaptation of the Tk widget demo.
  3. ;;;;
  4. ;;;; This demonstration script creates a toplevel window containing
  5. ;;;; several button widgets.
  6. ;;;;
  7.  
  8. (define (demo-button)
  9.   (let ((w (make-demo-toplevel "button"
  10.                    "Button Demonstration" 
  11.                    "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button.  You can press Tab to move among the buttons, then press Space to invoke the current button.")))
  12.     
  13.     ;; Create the 4 buttons
  14.     (for-each (lambda (x)
  15.         (pack (make <Button> 
  16.                 :text (car x)
  17.                 :parent w
  18.                 :width 10
  19.                 :command (lambda() (set! (background w) (cadr x))))
  20.               :side "top" 
  21.               :expand #t 
  22.               :pady 2))
  23.           '(("Peach Puff" "PeachPuff1")
  24.         ("Light Blue" "LightBlue1")
  25.         ("Sea Green"  "SeaGreen2")
  26.         ("Yellow"     "Yellow1")))))
  27.